// 关卡内容生成器
const LevelContentGenerator = {
    // 奇遇内容池
    encounters: [
        { id: 'e1', name: '神秘商人', difficulty: 1, reward: '获得随机物品' },
        { id: 'e2', name: '幻想乡茶会', difficulty: 2, reward: '恢复生命值' },
        { id: 'e3', name: '妖精的恶作剧', difficulty: 3, reward: '随机效果' }
    ],

    // 商店内容池
    shops: [
        { id: 's1', name: '杂货店', difficulty: 1, items: ['普通药水', '铁剑'] },
        { id: 's2', name: '魔法商店', difficulty: 2, items: ['魔法卷轴', '法杖'] },
        { id: 's3', name: '稀有商店', difficulty: 3, items: ['神器', '符卡'] }
    ],

    // 战斗内容池
    battles: [
        { id: 'b1', name: '妖精战斗', difficulty: 1, enemies: ['小妖精', '中妖精'] },
        { id: 'b2', name: '式神战斗', difficulty: 2, enemies: ['狐狸式神', '天狗'] },
        { id: 'b3', name: 'BOSS战斗', difficulty: 3, enemies: ['蕾米莉亚', '芙兰'] }
    ],

    // 事件内容池
    events: [
        { id: 'v1', name: '幻想乡日常', difficulty: 1, choices: ['参与', '离开'] },
        { id: 'v2', name: '妖怪异变', difficulty: 2, choices: ['调查', '报告'] },
        { id: 'v3', name: '红雾事件', difficulty: 3, choices: ['解决', '逃跑'] }
    ],

    // 根据难度和类型随机生成内容
    generateContent(type, difficulty) {
        let pool;
        switch(type) {
            case NodeType.ENCOUNTER:
                pool = this.encounters;
                break;
            case NodeType.SHOP:
                pool = this.shops;
                break;
            case NodeType.BATTLE:
                pool = this.battles;
                break;
            case NodeType.EVENT:
                pool = this.events;
                break;
            default:
                throw new Error('未知的节点类型');
        }

        // 使用难度过滤器
        const filter = new DifficultyFilter(difficulty);
        const availableContent = filter.filter(pool);
        
        // 随机选择一个内容
        return availableContent[Math.floor(Math.random() * availableContent.length)];
    }
}; 